package com.sanen.flyer.entity;

import com.sanen.flyer.entity.blast.Blast;
import com.sanen.flyer.factory.BlastFactory;

/**
 * @author wsse
 * @date 2018-09-06 19:21
 */
public abstract class Aircraft extends FlyObject{
    public Blast getBlast(){
        return BlastFactory.getBlast(BlastFactory.BLAST_ENEMY,x+width/2,y+height/2);
    }
    public boolean byHit(Bullet o){
        if (x+width-paddingR<o.getX()+o.getPaddingL()||x+paddingL>o.getX()+o.getWidth()-o.getPaddingR()
                ||y+height-paddingB<o.getY()+o.getPaddingT()||y+paddingT>o.getY()+o.getHeight()-o.getPaddingB()){
            return false;
        }
        
        return true;
    }
}
